#include "GameScene.h"

GameScene* GameScene::createScene(int level) {
	GameScene *scene = new GameScene();
	if (scene && scene->initScene(level)) {
		scene->autorelease();
		return scene;
	}
	CC_SAFE_DELETE(scene);
	return nullptr;
}

bool GameScene::initScene(int level) {
	if (!Scene::init()) return false;
	auto layer = GameLayer::createLayer(level);
	this->addChild(layer);
	return true;
}